import { del, get, post, put } from "@/utils/request";
import { type AddParams, type ListData, type ListParams, type ListResult } from "./type";

export const getTemperatureList = (data: ListParams) => {
  return get<ListParams, ListResult>("/api/temperature/list", data);
};

//添加
export const addTemperature = (data: AddParams) => {
  return post<AddParams, ListData>("/api/temperature/add", data);
};
//修改
export const updateTemperature = (data: AddParams) => {
  return put<AddParams, ListData>("/api/temperature/update", data);
};
//获取单条
export const getTemperatureModel = (id: number) => {
  return get<null, ListData>(`/api/temperature/get/${id}`);
};
//删除
export const delTemperature = (id: number) => {
  return del<null, null>(`/api/temperature/delete/${id}`);
};
//批量删除
export const delTemperatureMany = (ids: number[]) => {
  return post<number[], null>("/api/temperature/deleteAll", ids);
};
